module AuthFuncs

  def auth_required
    deny_access unless signed_in?
  end

  def deny_access(msg = nil)
    redirect_to new_user_session_path, :alert => msg || "Access denied."
  end

  def current_user
    signed_in? ? super : nil
  end
end